package com.huaxin.device.constant;

import com.huaxin.device.models.AlarmMessageParam;

import java.util.Arrays;
import java.util.List;

/**
 * 报警消息模板参数元数据集中定义
 */
public class AlarmMessageParams {

    public static final List<AlarmMessageParam> PARAMS = Arrays.asList(
            // 设备信息
            param("deviceName", "设备名称", "CB-001", "设备信息"),
            param("deviceId", "设备ID", "d123e456-789a-bcde-f012-3456789abcde", "设备信息"),
            param("deviceModel", "设备型号", "CB-A200", "设备信息"),
            param("zoneName", "区域", "客厅区域", "设备信息"),
            param("location", "安装位置", "配电房A01", "设备信息"),
            param("deviceType", "设备类型", "断路器", "设备信息"),

            // 报警规则
            param("alarmType", "报警类型", "过流", "报警规则"),
            param("thresholdValue", "阈值", "12.0", "报警规则"),
            param("unit", "单位", "A", "报警规则"),
            param("comparisonOp", "比较操作", ">", "报警规则"),
            param("alarmLevel", "报警等级", "严重", "报警规则"),
            param("durationSec", "持续时间", "10", "报警规则"),
            param("cooldownSec", "冷却时间", "300", "报警规则"),

            // 实时数据
            param("currentValue", "当前值", "15.6", "实时数据"),

            // 时间
            param("createdAt", "触发时间", "2025-08-17 10:30:00", "系统"),
            param("triggerTime", "触发时间", "2025-08-17 10:30:00", "系统")
    );

    private static AlarmMessageParam param(String param, String label, String example, String source) {
        return AlarmMessageParam.of(param, label, example, source);
    }

    /**
     * 获取所有可用参数（供前端接口使用）
     */
    public static List<AlarmMessageParam> getAll() {
        return PARAMS;
    }
}